<!-- 
  @author 善良的YWJ
  @Created by shanliangdeYWJ on 2021/07/09 03:22:11
  @file Functional.vue
  @description
  ```
  Functional 函数式组件
  原本的 functional 被移除了
  [参见](https://v3.cn.vuejs.org/guide/migration/functional-components.html#单文件组件-sfc)
  ```
  @link [Github](https://github.com/shanliangdeYWJ)
-->
<script>
import { h } from "vue";

// vue3 函数式组件 只能用函数方式声明
function Heading(props, context) {
  console.log("context 拥有的选项", context);
  return h(`h${props.level}`, context.attrs, context.slots);
}

Heading.props = {
  level: { type: Number, default: 1 },
};

export default Heading;
</script>
